/*
 * @Description: 
 * @version: 
 * @Author: hui.wang01
 * @Date: 2020-12-15 11:21:56
 * @LastEditors: hui.wang01
 */
//promise 测试题

var foo = 100
async function main () {
  console.log('main',foo)
  // foo = foo + await Promise.resolve(10)
  foo = await Promise.resolve(10) + foo
  console.log('main',foo)
}
main()
foo++
console.log('global',foo)
 
const date = '2020-12-17'
const reg = /(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/
const res = reg.exec(date)
console.log(res)